Packet relaying method and device

ABSTRACT

In a network of a variable length packet system, a bps calculator colors an inputted packet based on a peak bandwidth or a committed bandwidth of a data bit number per unit time for every flow and a packet length of the inputted packet, a pps calculator colors the inputted packet based on a peak bandwidth or a committed bandwidth of a packet number per unit time for every flow and a packet number of the inputted packet, and one of a color of packet to be discarded, a color of packet to be passed and a color of packet to be discarded with a probability, within the colors obtained by colorings at both calculators is determined by a color selector.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a packet relaying method and device,and in particular to a packet relaying method and device applied to arelaying device or the like within a communication network of a packetsystem.

2. Description of the Related Art

Owing to the Internet widespread and advanced, various kinds of datahave been distributed in large quantity on the Internet or an intranetadopting an Internet protocol. Namely, a variety of data such as ane-mail data or WWW data requiring no real time property, an IP telephonerequiring strict real time property, accounting system data requiring ahigh-speed and reliable data transfer, and the like share the sametransmission line to be transmitted.

The Internet protocol (IP) that is a data communication rule used forthe Internet is basically designed to treat the entire data equally.Therefore, on the network where a mixture of important and unimportantdata is distributed, a problem occurs that a bandwidth for the importantdata is generally lost when the bandwidth is consumed by thetransmission of the unimportant data.

In order to solve this problem, a method of enhancing the rate of atransmission path itself has been conventionally adopted. Although thismethod can improve the communication quality in the easiest way, theinvestment for new plant and equipment is high, and the plant andequipment become wasteful in a time zone while data do not flow, in caseof burst data where an intermittent flow of large amount of data beingconcentrated in a short time like transmission/reception of e-mails.Thus, this method is not economically preferable.

Therefore, a technology for controlling a bandwidth by classifying dataaccording to importance/unimportance and a real time property, and byassigning a large bandwidth to important data and data with a high realtime property, and a small bandwidth to unimportant data with a low realtime property has been developed. This is a network QoS (Quality ofService) technology.

The QoS generally indicates a service quality. However, the QoS of thenetwork mainly indicates a quality concerning a transmission rate and atransmission delay. The QoS technology is installed in a packet relaying(switching) device on a network. A network designer designs a bandwidthcontrol policy of the entire network, and guarantees or commits the QoSof the network by applying this policy to the relaying device existingon the network.

FIG. 5 shows a general arrangement of a network including such a packetrelaying device, where a packet relaying device 2 having received apacket from a network 1 transmits the packet to terminals (servers)5_1-5 _(—) n (hereinafter, occasionally represented by a referencenumeral “5”) through an L2 switch 3 and load balancers 4_1 and 4_2(hereinafter, occasionally represented by a reference numeral “4”). Inthis example, a packet of 10 Gbps from the packet relaying device 2 isconfined or shaped to a packet of 1 Gbps by the L2 switch 3, which isfurther dispersed into packets of 100 Mbps by the load balancers 4 to beprovided to the terminals 5. It is supposed that eight terminals 5 areconnected to each of the load balancers 4.

FIG. 6 shows a prior art arrangement of a bandwidth control (shaping)system in the packet relaying device shown in FIG. 5. This arrangementis composed of a metering processor 11, a WRED (Weighted Random EarlyDetection) processor 12, a queue portion 13, and a scheduler 14. It issupposed in this example that the flow per packet is specified(including information for identifying a packet flow).

Firstly, the metering processor 11 meters a quantity of a data flow (bitnumber=number of bit, per unit time) of inputted packets per flow. Apeak (limit) token counter (data bit number=number of data bit) and acommitted (guaranteed) token counter (packet number=number of packet) ofthe concerned flow are calculated from the time when the packets of theconcerned flow came before, the present time, the length of an inputtedpacket, the peak bandwidth (Bp), and the committed bandwidth (Bc). Bycomparing the bit number calculated with the packet length of theinputted packets, information concerning the flow state is assigned tothe inputted packets. This flow state information is represented bycolors (typically three colors of red, yellow and blue) in conformancewith a traffic signal (see e.g. non-patent documents 1 and 2). In thiscase, red means a packet which exceeds the peak bandwidth and is to bediscarded, and blue means a packet to be passed. Adding the informationto the packet is called “coloring”.

The WRED processor 12 performs discarding with a probability based on acolor attached by the metering processor 11 and the length of all thepackets in the queue portion 13 to which the packets are to enter.Namely, the queue portion 13 is allocated a single queue per each flow.The WRED processor 12 performs discarding when the packet number in thequeue is equal to or more than an upper limit value (designated value)and performs passing when the packet number is equal to or less than alower limit value (designated value). When the packet number is betweenthe upper limit value and the lower limit value, the WRED processor 12performs discarding with a probability, whereby the packet is discardedin case of red, the packet is passed in case of blue and the packet isdiscarded based on a probability calculated according to the queuenumber in the queue portion in case of yellow.

The scheduler 14 schedules an output order and an output interval of thepackets according to a metering subject of each queue and a prioritydesignated per queue.

It is to be noted that as a technology for avoiding an overflow of aqueue in bandwidth controlling (shaping) upon burst occurrence there area shaping processing device and method (see e.g. patent document 1).

-   -   [Non-patent document 1] Heinanen, J. and R. Guerin, “A Single        Rate Three Color Marker”, RFC2697, 1999. (http://www.IETF.org.)    -   [Non-patent document 2] Heinanen, J. and R. Guerin, “A Two Rate        Three Color Marker”, RFC2698, 1999. (http://www.IETF.org.)    -   [Patent document 1]    -   Japanese Patent Application Laid-open No. 10-173664

In the conventional technology, metering of a quantity of data flow atthe metering processor has been performed by a data bit number per unittime (generally expressed by a unit of bps (bit per second)) asmentioned above. This is because communication quality guarantee (QoS)firstly aims to avoid congestion of a data transmission line.

However, most of servers and load balancers do not have packetthroughput enough to get the most out of line ability. This is due tocomplicated contents of various services performed by the servers. Also,even if the speed of the data line is enhanced, when the throughput ofthe packet relaying device does not catch up with such a speedenhancement, the packet relaying device itself becomes a bottleneck andthe case where the QoS set can not be satisfied occurs. The packetthroughput of the server, the load balancer and the packet relayingdevice is expressed by the packet processing number per unit time, andpps (packet per second) is generally used for its unit.

In case of a transmission system of a fixed length packet such as an ATM(Asynchronous Transfer Mode), the QoS including the throughput of thedevice can be regulated to some extent by controlling bps since bps isnearly proportional to pps. However, in case of a transmission system inwhich a packet length is variable such as the Ethernet (registeredtrademark), correlation between the bit number (bps) and the packetnumber (pps) is low. It is impossible to take account of the packetthroughput of the device in the bandwidth control regulated solely bythe bit number (bps) or the packet number (pps). Therefore, in thenetwork of a variable length packet system including a server loadbalancer or the like whose packet throughput is low, a desired QoS hasnot been obtained in some cases.

This will now be described referring to packet relaying systems [1] and[2] respectively shown in FIGS. 7A, 7B, 8A and 8B.

Firstly, when a line rate (speed) on the output side of the packetrelaying device 2 is confined to 1 Gbps as shown in FIG. 7A and thepacket transmitted is supposed to be the shortest packet of 64 bytes,the output data assume 1,480,000 pps. Supposing that the throughput ofthe load balancer 4 is 800,000 pps, 680,000 packets will be lost.Namely, supposing that eight terminals 5 are connected to the loadbalancer 4 and a request throughput of the terminal 5 is 100,000 pps perterminal, the packets are discarded on the side of the terminal 5 whenthe packets of equal to or more than 800,000 pps are flowed to the loadbalancer 4.

On the other hand, when the packet transmitted at the same rate is thelongest packet of 1,514 bytes, as shown in FIG. 7B, the output databecome 80,000 pps. Although the throughput of the load balancer 4 is notexceeded in this case, there is a problem that only 1/10 is worked.

Furthermore, when the line rate is confined to 800,000 pps as shown inFIG. 8A and the packet transmitted is the shortest packet of 64 bytes,the output data assume 600 Mbps. If the throughput of a load balancer 4is supposed to be 100 M×8=800 Mbps, the output data of 600 Mbps will bepassed. However, when the packet transmitted at the same rate is thelongest packet of 1,514 bytes, as shown FIG. 8B, the output data assume10 Gbps, which is far beyond the throughput of the load balancer 4, sothat almost all the packets are to be discarded.

In the conventional bandwidth setting, it is best to set the linebandwidth of 1 Gbps for a line efficiency since there is only bpssetting. However, in that case, almost 1,500,000 pps of packets areflowed to the load balancer depending on the frame length. On the otherhand, when the line rate is confined to within 800,000 pps, thebandwidth has to be confined to about 600 Mbps in the bps setting.

Thus, only by the bandwidth control of the bit number (bps) or thepacket number (pps), the desired QoS can not be obtained.

SUMMARY OF THE INVENTION

It is accordingly an object of the present invention to provide a methodand device for performing a packet relay which can harmonize a data bitnumber (bps) with a packet number (pps) in a network of a variablelength packet system.

In order to achieve the above-mentioned object, a packet relaying methodaccording to the present invention comprises: a first step of coloringan inputted packet based on a predetermined peak (limit) bandwidth of adata bit number (number of data bit) per unit time for every flow and apacket length of the inputted packet; a second step of coloring aninputted packet based on a predetermined peak bandwidth of a packetnumber (number of packet) per unit time for every flow and a packetnumber of the inputted packet; and a third step of determining a colorof the inputted packet with a higher priority being given to a color ofpacket to be discarded, within the colors obtained by colorings at thefirst and the second steps.

Namely, at the first step an inputted packet is colored based on apredetermined peak bandwidth of a data bit number (quantity of data bitflow) preset per unit time for every flow and a packet length of theinputted packet. At the second step an inputted packet is colored basedon a predetermined peak bandwidth of a packet number (quantity of packetflow) preset per unit time for every flow and a packet number of theinputted packet. At the third step a color of the inputted packet isdetermined with a higher priority being given to a color of packet to bediscarded (red) within the colors thus obtained by colorings at thefirst and the second steps.

Thus, it becomes possible to designate both of the predetermined peakbandwidths of the quantity of the data bit flow and the quantity of thepacket flow, thereby enabling a packet flow bandwidth to be controlledwithout devouring the bandwidth.

Also, in a packet relaying method according to the present inventioncomprises: a first step of coloring an inputted packet based on apredetermined committed (guaranteed) bandwidth of a data bit number perunit time for every flow and a packet length of the inputted packet; asecond step of coloring an inputted packet based on a predeterminedcommitted bandwidth of a packet number per unit time for every flow anda packet number of the inputted packet; and a third step of determininga color of the inputted packet with a higher priority being given to acolor of packet to be discarded with a probability (partly discarded orpassed)(yellow), within the colors obtained by colorings at the firstand the second steps.

Namely, in this method, a predetermined committed bandwidth issubstituted for the above-mentioned predetermined peak bandwidth, sothat it is made possible to simultaneously set predetermined committedbandwidths of the quantity of the data bit and the quantity of thepacket flow, thereby committing the rate and controlling the packet flowbandwidth to pass important packets to such an extent as not to devourthe bandwidth.

Furthermore, in a packet relaying method according to the presentinvention comprises: a first step of coloring an inputted packet basedon a first predetermined peak bandwidth of a data bit number per unittime for every flow, a first predetermined committed bandwidth and apacket length of the inputted packet; a second step of coloring aninputted packet based on a second predetermined peak bandwidth of apacket number per unit time for every flow, a second predeterminedcommitted bandwidth and a packet number of the inputted packet; and athird step of determining one of a color of packet to be discarded(red), a color of packet to be passed (blue) and a color of packet to bediscarded with a probability (yellow), within the colors obtained bycolorings of the first and second steps.

Namely, in this method, by using both of the above-mentionedpredetermined peak bandwidths and committed bandwidths, one of a colorof packet to be discarded, a color of packet to be passed or a color ofpacket to be discarded with a probability (partly passed) is determinedto be assigned to the inputted packet. Thus, it becomes possible not todevour the bandwidth and to more efficiently provide important packets.

The above-mentioned data bit number (peak token counter) may be a valueincreased by the peak bandwidth from the data bit number at a packetinput time and the packet number (peak token counter) may be a valueincreased by the predetermined peak bandwidth from the packet number ata packet input time; when the data bit number is smaller than the packetlength of the inputted packet at the first step, the inputted packet maybe colored in red as the color of packet to be discarded, whileotherwise the inputted packet may be colored in blue, and when thepacket number is smaller than the packet number of inputted packet atthe second step, the inputted packet may be colored in red, whileotherwise the inputted packet may be colored in blue.

Alternatively, the above-mentioned data bit number (committed tokencounter) may be a value increased by the predetermined committedbandwidth from the data bit number at a packet input time and the packetnumber (committed token counter) may be a value increased by thepredetermined committed bandwidth from the packet number at a packetinput time; when the data bit number is larger than the packet length ofthe inputted packet at the first step, the inputted packet may becolored in blue as the color of packet to be passed, while otherwise theinputted packet may be colored in red, and when the packet number islarger than the packet number of the inputted packet at the second step,the inputted packet may be colored in blue, while otherwise the inputtedpacket may be colored in red.

Furthermore, the above-mentioned data bit number may include first andsecond bit numbers respectively increased by the first predeterminedpeak bandwidth and the first predetermined committed bandwidth from thedata bit number at a packet input time and the packet number may includefirst and second packet numbers respectively increased by the secondpredetermined peak bandwidth and the second predetermined committedbandwidth from the packet number at a packet input time; when the firstbit number is smaller than the packet length of the inputted packet atthe first step, the inputted packet may be colored in red as the colorof packet to be discarded; when the first bit number is larger than thepacket length and the second bit number is larger than the packetlength, the inputted packet may be colored in blue as the color ofpacket to be passed; while otherwise the inputted packet may be coloredin yellow; when the first packet number is smaller than the packetnumber of the inputted packet at the second step, the inputted packetmay be colored in red as the color of packet to be discarded; when thefirst packet number is larger than the packet number and the secondpacket number is larger than the packet number, the inputted packet maybe colored in blue as the color of packet to be passed; while otherwisethe inputted packet may be colored in yellow; and the color of theinputted packet may be determined with a higher priority being given tored, yellow, and blue in this order upon occurrence of conflict at thethird step.

A packet relaying device for realizing the above-mentioned packetrelaying method according to the present invention comprises: firstmeans coloring an inputted packet based on a predetermined peakbandwidth of a data bit number per unit time for every flow and a packetlength of the inputted packet; second means coloring an inputted packetbased on a predetermined peak bandwidth of a packet number per unit timefor every flow and a packet number of the inputted packet; and thirdmeans determining a color of the inputted packet with a higher prioritybeing given to a color of packet to be discarded, within the colorsobtained by colorings at the first and the second means.

Alternatively, a packet relaying device according to the presentinvention comprises: first means coloring an inputted packet based on apredetermined committed bandwidth of a data bit number per unit time forevery flow and a packet length of the inputted packet; second meanscoloring an inputted packet based on a predetermined committed bandwidthof a packet number per unit time for every flow and a packet number ofthe inputted packet; and third means determining a color of the inputtedpacket with a higher priority being given to a color of packet to bediscarded with a probability, within the colors obtained by colorings atthe first and the second means.

Furthermore, a packet relaying device according to the present inventioncomprises: first means coloring an inputted packet based on a firstpredetermined peak bandwidth of a data bit number per unit time forevery flow, a first predetermined committed bandwidth and a packetlength of the inputted packet; second means coloring an inputted packetbased on a second predetermined peak bandwidth of a packet number perunit time for every flow, a second predetermined committed bandwidth anda packet number of the inputted packet; and third means determining oneof a color of packet to be discarded, a color of packet to be passed anda color of packet to be partly discarded, within the colors obtained bycolorings of the first and second means.

The above-mentioned data bit number may be a value increased by thepredetermined peak bandwidth from the data bit number at a packet inputtime and the packet number may be a value increased by the predeterminedpeak bandwidth from the packet number at a packet input time; when thedata bit number is smaller than the packet length of the inputted packetat the first means, the inputted packet may be colored in red as thecolor of packet to be discarded, while otherwise the inputted packet maybe colored in blue, and when the packet number is smaller than thepacket number of the inputted packet at the second means, the inputtedpacket may be colored in red, while otherwise the inputted packet may becolored in blue.

Alternatively, the above-mentioned data bit number may be a valueincreased by the predetermined committed bandwidth from the data bitnumber at a packet input time and the packet number may be a valueincreased by the predetermined committed bandwidth from the packetnumber at a packet input time; when the data bit number is larger thanthe packet length of the inputted packet at the first means, theinputted packet may be colored in blue as the color of packet to bepassed, while otherwise the inputted packet may be colored in red, andwhen the packet number is larger than the packet number of the inputtedpacket at the second means, the inputted packet may be colored in blue,while otherwise the inputted packet may be colored in red.

Alternatively, the above-mentioned data bit number may include first andsecond bit numbers respectively increased by the first predeterminedpeak bandwidth and the first predetermined committed bandwidth from thedata bit number at a packet input time and the packet number may includefirst and second packet numbers respectively increased by the secondpredetermined peak bandwidth and the second predetermined committedbandwidth from the packet number at a packet input time; when the firstbit number is smaller than the packet length of the inputted packet atthe first means, the inputted packet may be colored in red as the colorof packet to be discarded; when the first bit number is larger than thepacket length and the second bit number is larger than the packetlength, the inputted packet may be colored in blue as the color ofpacket to be passed; while otherwise the inputted packet may be coloredin yellow; when the first packet number is smaller than the packetnumber of the inputted packet at the second means, the inputted packetmay be colored in red as the color of packet to be discarded; when thefirst packet number is larger than the packet number and the secondpacket number is larger than the packet number, the inputted packet maybe colored in blue as the color of packet to be passed; while otherwisethe inputted packet may be colored in yellow; and the color of theinputted packet may be determined with a higher priority being given tored, yellow, and blue in this order upon occurrence of conflict at thethird means.

Also, in the present invention, a packet relaying device is providedwhich comprises: first means coloring an inputted packet based on apredetermined peak bandwidth of a data bit number per unit time forevery flow, a predetermined committed bandwidth and a packet length ofthe inputted packet; second means coloring an inputted packet based on apredetermined peak bandwidth of a packet number per unit time for everyflow, a predetermined committed bandwidth and a packet number of theinputted packet; and third means determining a color of the inputtedpacket with a higher priority being given to a color of packet to bediscarded, a color of packet to be discarded with a probability, and acolor of packet to be passed in this order, within the colors obtainedby colorings at the first and the second means.

According to the present invention, since shaping can be performed byboth of the data bit number (bps) and the packet number (pps), both ofthe congestions of the lines and the devices can be controlled and anetwork with more stable QoS can be structured.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objects and advantages of the invention will beapparent upon consideration of the following detailed description, takenin conjunction with the accompanying drawings, in which the referencenumerals refer to like parts throughout and in which:

FIG. 1 is a block diagram showing an embodiment of a metering processorused in a packet relaying method and device according to the presentinvention;

FIG. 2 is a flowchart showing a processing procedure example of a bpscalculator used in the metering processor shown in FIG. 1;

FIG. 3 is a flowchart showing a processing procedure example of a ppscalculator used in the metering processor shown in FIG. 1;

FIGS. 4A-4C are diagrams showing a color determination sequence and acolor selector output by calculators shown in FIGS. 2 and 3;

FIG. 5 is a diagram showing a network arrangement of a packet systemapplied to the present invention and the conventional technology;

FIG. 6 is a block diagram showing a general arrangement of the packetrelaying device shown in FIG. 5;

FIGS. 7A and 7B are diagrams showing a packet relaying system [1] in thenetwork arrangement shown in FIG. 5; and

FIGS. 8A and 8B are diagrams showing a packet relaying system [2] in thenetwork arrangement shown in FIG. 5.

DESCRIPTION OF THE EMBODIMENTS

Hereinafter, an embodiment of the packet relaying method and deviceaccording to the present invention will be described referring to theattached figures.

FIG. 1 shows an embodiment according to the present invention of themetering processor 11 of the packet relaying device shown in FIG. 6. Themetering processor 11 performs metering in terms of both data bit number(bps) and packet number (pps).

In this embodiment, an information setting portion 21 is connected totransmit setting contents designated by a user to a bps calculator 22and a pps calculator 23. The setting values from the information settingportion 21 to the bps calculator 22 are initial values Tp1(0) andTc1(0), a bit number-peak bandwidth Bp1 and a bit number-committedbandwidth Bc1. An example of the bit number-peak bandwidth Bp1 in thisembodiment is 1 Gbps as shown in bandwidth settings (a) and (b) of FIG.5, and an example of the bit number-committed bandwidth Bc1 is 100 Mbps.

Also, the setting values from the information setting portion 21 to thepps calculator 23 are initial values Tp2(0) and Tc2(0), a packetnumber-peak bandwidth Bp2 and a packet number-committed bandwidth Bc2.An example of the packet number-peak bandwidth Bp2 in this embodiment is0.8 Mpps (800,000 pps) as shown in the bandwidth settings (a) and (b) ofFIG. 5 similarly, and an example of the packet number-committedbandwidth Bc2 is 0.2 Mpps (200,000 pps).

The initial value Tp1(0) is referred to as a Peak Burst Size (PBS), thatis a value for limiting the maximum value of the quantity of the databit flow which can be outputted at a burst time.

Also, the initial value Tc1(0) is referred to as a Committed Burst Size(CBS), that is a setting value for committing the minimum value of thequantity of the data bit flow which can be outputted at a burst time. Inthe flow to which the committed burst size is set, a communication morethan the committed burst size can be performed upon burst occurrence.

Also, the initial value Tc2(0) is referred to as a Peak Burst Packet(PBP), that is a setting value for limiting the maximum value of thequantity of the packet flow which can be outputted at a burst time inthe same way as the peak burst size.

Furthermore, the initial value Tc2(0) is referred to as a CommittedBurst Packet (CBP), that is a setting value for committing the minimumvalue of the quantity of the packet flow which can be outputted at aburst time.

Also, “peak bandwidth” indicates the maximum bandwidth (maximum quantityof flow) which can be used by a certain flow. It is possible to set thebandwidth in terms of both bit number (bps) and packet number (pps).

Also, “committed bandwidth” indicates the minimum bandwidth (quantity offlow) to be committed or guaranteed for a certain flow. This case makesit possible to set the bandwidth in terms of both bit number (bps) andpacket number (pps).

An information extractor 24 extracts from a packet PKT inputted a packetlength to be provided to the bps calculator 22, and extracts the packetnumber to be provided to the pps calculator 23. In this case, theinformation extractor 24 provides the packet length and the packetnumber for every flow, i.e. for every identical flow identifier to thebps calculator 22 and the pps calculator 23 respectively.

The bps calculator 22 performs a color determination for the inputs, andoutputs a color output CL1 to a color selector 25. The pps calculator 23also performs a color determination for the inputs, and provides a coloroutput CL2 to the color selector 25. The color selector 25 determines aflow state for the inputted packet PKT based on the color outputs CL1and CL2 to be provided as a color selection signal to a colorinformation assigning portion 26. The color information assigningportion 26 has both of packets and color information, and assigns thecolor information to the packet PKT to be transferred to a WREDprocessor 12 at the subsequent stage. The flow of packet processinghereafter is the same as the conventional technology shown in FIG. 6.

bps Calculator 22

FIG. 2 shows an example of a processing procedure in the bps calculator22 shown in FIG. 1. Firstly, when it is notified to the bps calculator22 from the information extractor 24 that the packet of “A” bytes isinputted, Tp(t) is compared with the packet length A at step S1.

The Tp(t) is referred to as a peak token counter at a time “t”, takes avalue equal to or less than the peak burst size Tp(0) as mentionedabove, and indicates the packet number which can be outputted from thequeue portion 13 shown in FIG. 6.

Accordingly, when the peak token counter Tp(t) is less than the packetlength A (Tp(t)−A<0) at step S1, the packet is colored in “red”, sinceit is to be discarded (at step S2), while otherwise the process proceedsto step S3.

At step S3, Tc(t) is compared with the packet length A. Tc(t) in thiscase indicates a committed token counter at a time “t” and takes a valueequal to or less than the committed burst size Tc(0). When the committedtoken counter Tc(t) is less than the packet length A (Tc(t)−A<0), thepacket is colored in “yellow” since it is to be discarded with aprobability. At the same time, the peak token counter Tp(t) isdecremented by the packet length A (Tp(t)−A). Otherwise the processproceeds to step S5 (at step S4).

Since it is recognized that the committed token counter Tc(t) is largerthan the packet length A at step S5, the packet is to be passed and iscolored in “blue”. The peak token counter Tp(t) is decremented by thepacket length A (Tp(t)−A) and the committed token counter Tc(t) isdecremented by the packet length A(Tc(t)−A) to end the routine.

Hereafter, the peak token counter Tp(t) and the committed token counterTc(t) respectively change according to the following equations per timeτ seconds until the subsequent packet arrives:Tp(t+τ)=Tp(t)+Bp×τ  Eq. (1)Tc(t+τ)=Tc(t)+Bc×τ  Eq. (2)

Namely, the equation (1) indicates that the peak token counter Tp(t)increments by the peak bandwidth Bp in time τ seconds (however, the peaktoken counter Tp(t) does not exceed the peak burst size Tp(0)), and theequation (2) indicates that the committed token counter Tc(t) incrementsby the committed bandwidth Bc in time τ seconds (however, the committedtoken counter Tc(t) does not exceed the committed burst size Tc(0)).

FIG. 4A shows a sequence of processing procedure in the bps calculator22 shown in FIG. 2. This example indicates that the packets are inputtedat times t1-t9 and together with the input the color determination isperformed. It is to be noted that “1” is added to the token counter andthe burst size respectively in the bps calculator 22, while “2” is addedto the token counter and the burst size in the pps calculator 23described later, thereby distinguishing the token counter and the burstsize in the bps calculator 22 from those in the pps calculator 23.

As shown in FIG. 4A, the ordinate indicates the peak/committed tokencounter (data bit number). At the time t=0, the peak burst size Tp1(0)(PBS) and the committed burst size Tc1(0) (CBS) which are the initialvalues are set.

When the packet whose length is A1 is inputted to the metering processor11 at the time t1, the process in the bps calculator 22 having receivedthe packet proceeds to step S3 from step S1 in the flowchart of FIG. 2since Tp1(0)−A1>0 as shown in FIG. 4A. Since Tc1(0)−A1>0 at step S3, theprocess proceeds to step S5 from step S3. The coloring of the packet isset to “blue”, Tp1(t1) is updated to “Tp1(0)−A1”, and Tc1(t1) is updatedto “Tc1(t1)−A1”.

As a result, at the time t1 of FIG. 4A, the token counters Tp1(t1) andTc1(t1) respectively assumes values decreased from the burst sizesTp1(0) and Tc1(0) by the packet length A1.

As shown in the above-mentioned equations (1) and (2), the tokencounters Tp1(t) is increased by the peak bandwidth Bp1 (gradient) everytime τ seconds. It is to be noted that the peak bandwidth in this caseis “1 Gbps” as mentioned above.

Also, since the committed token counter Tc1(t) is similarly increased bythe committed bandwidth Bc1 (gradient) every time τ seconds, the tokencounters Tp1(t) and Tc1(t) are increased respectively by the gradientsBp1 and Bc1 from the time t1 to the time t2.

The peak token counter Tp1(2) at the time t2 is a value increased by thepeak bandwidth Bp1 from the value at the time t1. When the packet lengthof the inputted packet is A2 at the time t2, it is found thatTp1(t2)−A2>0 at step S1 in FIG. 2. Therefore, the process proceeds tostep S3 from step S1. Since Tc1(t2)−A2<0 at step S3 as shown in FIG. 4A,the process proceeds to step S4, the coloring of the packet is set to“yellow”, and the peak token counter Tp1(t) is decremented by the packetlength A2. Namely, the coloring at the time t2 becomes “yellow”, and thecolor output CL1 is provided to the color selector 25.

At the time t3 the peak token counter Tp1(t3) is similarly increased bythe peak bandwidth Bp1 from the value at the time t2 for a time τseconds. The committed token counter Tc1(t3) is also increased by thecommitted bandwidth Bc1. Supposing that the packet whose packet lengthis A3 is inputted at this time, it is found that Tp1(t3)−A3<0 in theexample of FIG. 4A. In this case the coloring of the packet is set to“red” without confirming the relationship between the committed tokencounter Tc1(t3) and the packet length A3 (at step S2). Accordingly,updating the token counter as shown at steps S4 and S5 is not performed,and the peak token counter Tp1(t) continues to increase by the peakbandwidth Bp1 from the time t2 to the time t4 through the time t3.Similarly, the token counter Tc1(t) continues to increase from the timet1 to the time t4 through the times t2 and t3.

Supposing that the packet length A4 is a length as shown in FIG. 4A whenthe packet whose length is A4 is inputted at the time t4, it is foundthat Tp1(t4)−A4>0. Accordingly, the process proceeds to step S3 fromstep S1. Since it is found that Tc1(t4)−A4>0 at step S3 as shown in FIG.4A, the process further proceeds to step S5, the color output CL1 inwhich the coloring of the packet is set to “blue” is transmitted to thecolor selector 25, the peak token counter Tp1(t4) is decremented by thepacket length A4, and the committed token counter Tc1(t4) is similarlydecremented by the packet length A4.

Hereafter, the color determination is similarly performed at timest5-t9, and color output CL1 corresponding the determination is providedto the color selector 25.

pps Calculator 23

FIG. 3 shows a processing procedure example of the pps calculator 23shown in FIG. 1. The difference between the processing procedure of FIG.3 and that of the bps calculator 22 shown in FIG. 2 is that a packetnumber P is substituted for the packet length A of the inputted packet.Accordingly, steps S1′-S5′ shown in FIG. 3 are indicated by adding anapostrophe (′) to corresponding steps S1-S5 in FIG. 2. The processingprocedure of FIG. 3 will now be described referring to the colordetermination sequence at the pps calculator 23 shown in FIG. 4B.

As shown in FIG. 4B, the ordinate indicates the peak/committed tokencounter (packet number). At the time t=0, the peak burst packet Tp2(0)(PBP) and the committed burst packet Tc2(0) (CBP) that are the initialvalues are set.

When the packets PKT of number P1 are inputted to the metering processor11 at the time t1, the process proceeds to S3′ from step S1′ in theflowchart of FIG. 3 since Tp2(0)−P1>0, as shown in FIG. 4B, at the ppscalculator 23 having received the packets. Since Tc2(0)−P1>0, as shownin FIG. 4B, at step S3′, the process proceeds to step S5′ from step S3′,the coloring of the packet is set to “blue”, Tp2(t1) is updated to“Tp2(0)−P1”, and the Tc2(t1) is updated to “Tc2(0)−P1”.

As a result, at the time t1 of FIG. 4B, the token counters Tp2(t) andTc2(t) respectively become values in which the burst packets Tp2(0) andTc2(0) are decreased by the packet number P1.

As shown in the above-mentioned equations (1) and (2), the token counterTp2(t) is increased by the peak bandwidth Bp2 (gradient) every τseconds. It is to be noted that the peak bandwidth in this case is“800,000 pps” as mentioned above.

Also, since the committed token counter Tc2(t) is similarly increased bythe committed bandwidth Bc2 (gradient) every τ seconds, the tokencounters Tp2(t) and Tc2(t) are increased by the gradients Bp2 and Bc2respectively from the time t1 to the time t2.

At the time t2, the peak token counter Tp2(t2) is increased by the peakbandwidth Bp2 from the value at the time t1. When the packet number ofthe inputted packet is P2 at the time t2, the process proceeds to stepS3‘from step S1’ since Tp2(t2)−P2>0 at step S1′ of FIG. 3. SinceTc2(t2)−P2>0 at step S3′ as shown in FIG. 4B, the process proceeds tostep S5′, the coloring of packet is set to “blue” in the same way as thecase at the time t1, so that the token counters Tp2(t2) and Tc2(t2) aredecremented by the packet number P2. Namely, at the time t2, the coloroutput CL2 in which the coloring is “blue” is provided to the colorselector 25.

At the time t3, based on the packet number P3, the color output CL2 inwhich the coloring is “blue” in the same way as the case at times t1 andt2 is provided to the color selector 25.

At the time t4, the token counter Tp2(t) is similarly increased by thepeak bandwidth Bp2 for a time r seconds from the time t3, and the tokencounter Tc2(t) is increased by the committed bandwidth Bc2. Supposingthat the packets of number P4 are inputted at this time, the processproceeds to step S3′ since Tp2(t4)−P4>0. Since Tc2(t4)−P4<0 at step S3′,the process proceeds to step S4′, the coloring of the packet is set to“yellow”, and the token counter Tp2(t4) is decremented by the packetnumber P4. Namely, the color output CL2 in which the coloring is“yellow” is provided to the color selector 25 at the time t4.

At the times t5 and t6, based on the packet number P5 and P6, the coloroutput CL2 in which the coloring is “yellow” is similarly provided tothe color selector 25.

When the packets of number P7 are inputted at the time t7, the tokencounter Tp2(t7)−P7<0 in the example of FIG. 4B. Therefore, the processproceeds to step S2′ from step S1′, and the color output CL2 in whichthe coloring of the packet is set to “red” is provided to the colorselector 25 without confirming the relationship between the tokencounter Tc2(t7) and the packet number P7.

Hereafter, the same procedure is performed at times t8 and t9, and thecolor output CL2 is provided to the color selector 25.

FIG. 4C shows the output of the color selector 25 which thus inputs thecolor output CL1 from the bps calculator 22 and the color output CL2from the pps calculator 23.

Namely, a selection algorithm of the color selector 25 indicates that ahigher priority is given to the color of packet to be discarded, and thecolor of the frame is finally determined from the color outputs CL1 andCL2. If either of the color outputs CL1 and CL2 is “red”, “red” isselected. If there is no “red” and either one is “yellow”, “yellow” ispreferentially selected. In other cases (in case of both are “blue”),“blue” is selected to be provided to the color information assigningportion 26. Accordingly, the color selection signals outputted from thecolor selector 25 become as shown in FIG. 4C at the times t1-t9 in FIGS.4A and 4B.

Thus, since the setting of “less than 1 Gbps and 800,000 pps” is enabledin the case of the packet relaying method of the present invention, whenthe frame length requested is long, the performance up to the linebandwidth 1 Gbps can be exerted, while when the frame length requestedis short, the performance up to 800,000 pps in total of the terminalscan be exerted.

1. A packet relaying method comprising: a first step of coloring aninputted packet based on a predetermined peak bandwidth of a data bitnumber per unit time for every flow and a packet length of the inputtedpacket; a second step of coloring an inputted packet based on apredetermined peak bandwidth of a packet number per unit time for everyflow and a packet number of the inputted packet; and a third step ofdetermining a color of the inputted packet with a higher priority beinggiven to a color of packet to be discarded, within the colors obtainedby colorings at the first and the second steps, wherein the data bitnumber is a value increased by the peak bandwidth from the data bitnumber at a packet input time and the packet number is a value increasedby the peak bandwidth from the packet number at a packet input time;when the data bit number is smaller than the packet length of theinputted packet at the first step, the inputted packet is colored in redas the color of packet to be discarded, while otherwise the inputtedpacket is colored in blue, and when the packet number is smaller thanthe packet number of the inputted packet at the second step, theinputted packet is colored in red, while otherwise the inputted packetis colored in blue.
 2. A packet relaying method comprising: a first stepof coloring an inputted packet based on a predetermined committedbandwidth of a data bit number per unit time for every flow and a packetlength of the inputted packet; a second step of coloring an inputtedpacket based on a predetermined committed bandwidth of a packet numberper unit time for every flow and a packet number of the inputted packet;and a third step of determining a color of the inputted packet with ahigher priority being given to a color of packet to be discarded with aprobability, within the colors obtained by colorings at the first andthe second steps, wherein the data bit number is a value increased bythe committed bandwidth from the data bit number at a packet input timeand the packet number is a value increased by the committed bandwidthfrom the packet number at a packet input time; when the data bit numberis larger than the packet length of the inputted packet at the firststep, the inputted packet is colored in blue as the color of packet tobe passed, while otherwise the inputted packet is colored in red, andwhen the packet number is larger than the packet number of the inputtedpacket at the second step, the inputted packet is colored in blue, whileotherwise the inputted packet is colored in red.
 3. A packet relayingmethod comprising: a first step of coloring an inputted packet based ona first predetermined peak bandwidth of a data bit number per unit timefor every flow, a first predetermined committed bandwidth and a packetlength of the inputted packet; a second step of coloring an inputtedpacket based on a second predetermined peak bandwidth of a packet numberper unit time for every flow, a second predetermined committed bandwidthand a packet number of the inputted packet; and a third step ofdetermining one of a color of packet to be discarded, a color, of packetto be passed and a color of packet to be discarded with a probability,within the colors obtained by colorings of the first and second steps,wherein the data bit number includes first and second bit numbersrespectively increased by the first predetermined peak bandwidth and thefirst predetermined committed bandwidth from the data bit number at apacket input time and the packet number includes first and second packetnumbers respectively increased by the second predetermined peakbandwidth and the second predetermined committed bandwidth from thepacket number at a packet input time; when the first bit number issmaller than the packet length of the inputted packet at the first step,the inputted packet is colored in red as the color of packet to bediscarded; when the first bit number is larger than the packet lengthand the second bit number is larger than the packet length, the inputtedpacket is colored in blue as the color of packet to be passed; whileotherwise the inputted packet is colored in yellow; when the firstpacket number is smaller than the packet number of the inputted packetat the second step, the inputted packet is colored in red as the colorof packet to be discarded; when the first packet number is larger thanthe packet number and the second packet number is larger than the packetnumber, the inputted packet is colored in blue as the color of packet tobe passed; while otherwise the inputted packet is colored in yellow; andthe color of the inputted packet is determined with a higher prioritybeing given to red, yellow, and blue in this order upon occurrence ofconflict at the third step.
 4. A packet relaying device comprising:first means coloring an inputted packet based on a predetermined peakbandwidth of a data bit number per unit time for every flow and a packetlength of the inputted packet; second means coloring an inputted packetbased on a predetermined peak bandwidth of a packet number per unit timefor every flow and a packet number of the inputted packet; and thirdmeans determining a color of the inputted packet with a higher prioritybeing given to a color of packet to be discarded, within the colorsobtained by colorings at the first and the second means, wherein thedata bit number is a value increased by the predetermined peak bandwidthfrom the data bit number at a packet input time and the packet number isa value increased by the predetermined peak bandwidth from the packetnumber at a packet input time; when the data bit number is smaller thanthe packet length of the inputted packet at the first means, theinputted packet is colored in red as the color of packet to bediscarded, while otherwise the inputted packet is colored in blue, andwhen the packet number is smaller than the packet number of the inputtedpacket at the second means, the inputted packet is colored in red, whileotherwise the inputted packet is colored in blue.
 5. A packet relayingdevice comprising: first means coloring an inputted packet based on apredetermined committed bandwidth of a data bit number per unit time forevery flow and a packet length of the inputted packet; second meanscoloring an inputted packet based on a predetermined committed bandwidthof a packet number per unit time for every flow and a packet number ofthe inputted packet; and third means determining a color of the inputtedpacket with a higher priority being given to a color of packet to bediscarded with a probability, within the colors obtained by colorings atthe first and the second means, wherein the data bit number is a valueincreased by the predetermined committed bandwidth from the data bitnumber at a packet input time and the packet number is a value increasedby the predetermined committed bandwidth from the packet number at apacket input time; when the data bit number is larger than the packetlength of the inputted packet at the first means, the inputted packet iscolored in blue as the color of packet to be passed, while otherwise theinputted packet is colored in red, and when the packet number is largerthan the packet number of the inputted packet at the second means, theinputted packet is colored in blue, while otherwise the inputted packetis colored in red.
 6. A packet relaying device comprising: first meanscoloring an inputted packet based on a first predetermined peakbandwidth of a data bit number per unit time for every flow, a firstpredetermined committed bandwidth and a packet length of the inputtedpacket; second means coloring an inputted packet based on a secondpredetermined peak bandwidth of a packet number per unit time for everyflow, a second predetermined committed bandwidth and a packet number ofthe inputted packet; and third means determining one of a color ofpacket to be discarded, a color of packet to be passed and a color ofpacket to be partly discarded, within the colors obtained by coloringsof the first and second means, wherein the data bit number includesfirst and second bit numbers respectively increased by the firstpredetermined peak bandwidth and the first predetermined committedbandwidth from the data bit number at a packet input time and the packetnumber includes first and second packet numbers respectively increasedby the second predetermined peak bandwidth and the second predeterminedcommitted bandwidth from the packet number at a packet input time; whenthe first bit number is smaller than the packet length of the inputtedpacket at the first means, the inputted packet is colored in red as thecolor of packet to be discarded; when the first bit number is largerthan the packet length and the second bit number is larger than thepacket length, the inputted packet is colored in blue as the color ofpacket to be passed; while otherwise the inputted packet is colored inyellow; when the first packet number is smaller than the packet numberof the inputted packet at the second means, the inputted packet iscolored in red as the color of packet to be discarded; when the firstpacket number is larger than the packet number and the second packetnumber is larger than the packet number, the inputted packet is coloredin blue as the color of packet to be passed; while otherwise theinputted packet is colored in yellow; and the color of the inputtedpacket is determined with a higher priority being given to red, yellow,and blue in this order upon occurrence of conflict at the third means.